package org.dialMsg.Mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.dialMsg.Pojo.TCrmCallLog;

import java.util.List;

/**
 * @author DPF
 */
@Mapper
public interface TCrmCallLogMapper {
    @Insert("<script>" +
            "INSERT INTO t_crm_call_log (crm_mobile, call_time, call_status, call_context, call_record_path, " +
            "biz_id, call_duration, duration_of_ringing, call_type, seat_phone, pro_city, carried, outbound_number, " +
            "cont_id, hangup_by, card_detail_id) VALUES " +
            "<foreach collection='list' item='item' separator=','>" +
            "(#{item.crmMobile}, #{item.callTime}, #{item.callStatus}, #{item.callContext}, #{item.callRecordPath}, " +
            "#{item.bizId}, #{item.callDuration}, #{item.durationOfRinging}, #{item.callType}, #{item.seatPhone}, " +
            "#{item.proCity}, #{item.carried}, #{item.outboundNumber}, #{item.contId}, #{item.hangupBy}, #{item.cardDetailId})" +
            "</foreach>" +
            "</script>")
    int batchInsert(@Param("list") List<TCrmCallLog> callLogs);
}
